import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
import SampleManagement from './modules/sample-management'
// import RoleManagement from './modules/role-management'
// import AccountManagement from './modules/account-management'
import ProjectManagement from './modules/project-management'
import SystemManagement from '@/router/modules/system-management'

/**
 * 私有路由表
 */
export const privateRoutes = [
  SampleManagement,
  // RoleManagement,
  // AccountManagement,
  ProjectManagement,
  SystemManagement
]

/**
 * 公开路由表
 */
export const publicRoutes = [
  {
    path: '/',
    alias: '/login',
    name: 'login',
    component: () =>
      import(/* webpackChunkName: "login" */ '@/views/login/index')
  },
  {
    path: '/404',
    name: '404',
    component: () => import(/* webpackChunkName: "error-page" */ '@/views/error-page/404')
  }
  // ,
  // {
  //   path: '/:catchAll(.*)',
  //   redirect: '/404'
  // }
]

const router = createRouter({
  history: process.env.VUE_APP_BUILD_MODE === 'static' ? createWebHashHistory() : createWebHistory(),
  routes: publicRoutes
})

export default router
